

// ignore_for_file: overridden_fields, body_might_complete_normally_nullable, prefer_const_constructors, unused_import

import 'package:flutter/material.dart';
import 'package:get/get.dart';

import '../router/app_pages.dart';

class RouteAuthMiddleware extends GetMiddleware {
  @override
  int? priority = 0;

  RouteAuthMiddleware({required this.priority});

  @override
  RouteSettings? redirect(String? route) {
    Future.delayed(
      Duration(milliseconds: 800), 
      () => Get.snackbar(
        "提示",
        "请先登录APP(中间件的作用)",
      )
    );
    return RouteSettings(name: AppRoutes.Home);
    // return null;
  }

}